<template>
    <div>
        <h2>表单校验示例</h2>
        <form action="">
            <div class="great-form-row">
                required：<input v-required great-emc="message-error"/>
                <div class="message-error"></div>
            </div>
            <div class="great-form-row">
                required2：<input v-required great-validator-options='{"errorMsgContainer":"required-message-error2", "errorMsg":"数字格式不正确，至少两位小数！"}'/>
                <div class="required-message-error2"></div>
            </div>
            <div class="great-form-row">
                email：<input v-email great-emc="email-message-error"/>
                <div class="email-message-error"></div>
            </div>
            <div class="great-form-row">
                mobile：<input v-mobile great-emc="mobile-message-error"/>
                <div class="mobile-message-error"></div>
            </div>
            <div class="great-form-row">
                number：<input v-number great-emc="number-message-error" great-validator-options='{"max":222, "min":10, "minScale":2, "maxScale":4, "errorMsg":"数字格式不正确，至少两位小数！"}'/>
                <div class="number-message-error"></div>
            </div>
            <div class="great-form-row">
                strLength：<input v-strLength great-emc="str-message-error" great-validator-options='{ "minLength":4,  "maxLength":10,  "errorMsg":"请输入4-10位字符！"}'/>
                <div class="str-message-error"></div>
            </div>
        </form>
    </div>
</template>

<script>
    import {DataTypeUtils} from "great-jsutils";
    import {greatFormValidator} from 'great-vue';
    export default {
        name: "form-demo01",
        directives: {
            required: greatFormValidator.required,
            email: greatFormValidator.email,
            mobile: greatFormValidator.mobile,
            number: greatFormValidator.number,
            strLength: greatFormValidator.strLength,
        },
        mounted() {
            console.log({...DataTypeUtils})
            console.log(DataTypeUtils.isNullValue('22'));
            console.log(greatFormValidator.required)
        }
    }
</script>

<style scoped>

</style>
